package com.ymatou.iapi.tradingsettlement.service;

import org.json.JSONException;
import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;

public class ManageFeeStatisticsCall extends YmatouBaseCall {
	
	private static String opurl = "api/search/getManageFeeStatistics";

	public ManageFeeStatisticsCall() {
		super(EnvSetup.getSystemUrl("tradingsettlement_iapi"), opurl, "POST", "JSON");
	}

	@Override
	public void addDefHeader() {
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	public JSONObject getJSONData() {
		
		JSONObject object = null;
		
		try {
			object = new JSONObject(getReturnData());
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return object;
		}
		
		return object;
	}
	
	public JSONObject getData() {
		
		JSONObject object = null;
		
		try {
			object = new JSONObject(getReturnData()).getJSONObject("data");
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return object;
		}
		
		return object;
	}
}
